package com.mars.springbootdemo;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("response")
public class ResponseTestController {

    private String name= "333";
    private String good= "777777777777777777";


    @GetMapping("")
    public String test() {
        return "{\n" +
                "  \"library\": {\n" +
                "    \"name\": \"城市中央图书馆\",\n" +
                "    \"location\": \"市中心文化大道88号\",\n" +
                "    \"establishmentYear\": 1990,\n" +
                "    \"totalBooks\": 150000,\n" +
                "    \"openingHours\": {\n" +
                "      \"weekday\": \"09:00-21:00\",\n" +
                "      \"weekend\": \"10:00-18:00\",\n" +
                "      \"holiday\": \"10:00-16:00\"\n" +
                "    },\n" +
                "    \"popularBooks\": [\n" +
                "      {\n" +
                "        \"id\": \"B001\",\n" +
                "        \"title\": \"人类简史\",\n" +
                "        \"author\": \"尤瓦尔·赫拉利\",\n" +
                "        \"publisher\": \"中信出版社\",\n" +
                "        \"publishYear\": 2014,\n" +
                "        \"category\": [\"历史\", \"社科\"],\n" +
                "        \"isAvailable\": true,\n" +
                "        \"borrowingCount\": 3280\n" +
                "      },\n" +
                "      {\n" +
                "        \"id\": \"B002\",\n" +
                "        \"title\": \"三体\",\n" +
                "        \"author\": \"刘慈欣\",\n" +
                "        \"publisher\": \"重庆出版社\",\n" +
                "        \"publishYear\": 2008,\n" +
                "        \"category\": [\"科幻\", \"小说\"],\n" +
                "        \"isAvailable\": false,\n" +
                "        \"borrowingCount\": 5642\n" +
                "      },\n" +
                "      {\n" +
                "        \"id\": \"B003\",\n" +
                "        \"title\": \"解忧杂货店\",\n" +
                "        \"author\": \"东野圭吾\",\n" +
                "        \"publisher\": \"南海出版公司\",\n" +
                "        \"publishYear\": 2014,\n" +
                "        \"category\": [\"小说\", \"悬疑\"],\n" +
                "        \"isAvailable\": true,\n" +
                "        \"borrowingCount\": 4129\n" +
                "      }\n" +
                "    ],\n" +
                "    \"services\": [\"借阅服务\", \"自习空间\", \"数字资源访问\", \"读书活动\"]\n" +
                "  }\n" +
                "}";
    }

    @GetMapping("1")
    public String test1() {
        return good;
    }
}
